
#ifndef VIEW_H
#define VIEW_H

#include <eq/eq.h>

#include "renderState.h"
#include <string>

namespace eqPc
{
    class View : public eq::View
    {
    public:
        View( eq::Layout* parent );
        virtual ~View();

        void setModelID( const eq::uint128_t& id );
        eq::uint128_t getModelID() const { return _modelID; }

        void setIdleSteps( const int32_t steps );
        int32_t getIdleSteps() const { return _idleSteps; }

        void toggleEqualizer();

    private:
        class Proxy : public co::Serializable
        {
        public:
            Proxy( View* view ) : _view( view ) {}

        protected:
            /** The changed parts of the view. */
            enum DirtyBits
            {
                DIRTY_MODEL = co::Serializable::DIRTY_CUSTOM << 0,
                DIRTY_IDLE  = co::Serializable::DIRTY_CUSTOM << 1
            };

            virtual void serialize( co::DataOStream& os,
                                    const uint64_t dirtyBits );
            virtual void deserialize( co::DataIStream& is, 
                                      const uint64_t dirtyBits );
            virtual void notifyNewVersion() { sync(); }

        private:
            View* const _view;
            friend class eqPc::View;
        };

        Proxy _proxy;
        friend class Proxy;
        eq::uint128_t _modelID;
        int32_t _idleSteps;
    };
}

#endif // EQ_PLY_VIEW_H
